/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.eventos.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
//import javax.persistence.NamedQueries;
//import javax.persistence.NamedQuery;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.cip.esymons.general.be.ConsejoDepartamental;

/**
 *
 * @author Lizardo Rios
 */
@Entity
@Table(name = "eca_curso")
@DiscriminatorValue("CU")
@PrimaryKeyJoinColumn(name = "cur_codigo", referencedColumnName = "eve_codigo")
//@NamedQueries({@NamedQuery(name = "Curso.findAll", query = "SELECT c FROM Curso c"),@NamedQuery(name = "Curso.findByCurVacantes", query = "SELECT c FROM Curso c WHERE c.curVacantes = :curVacantes"), @NamedQuery(name = "Curso.findByCurnroSesiones", query = "SELECT c FROM Curso c WHERE c.curnroSesiones = :curnroSesiones"), @NamedQuery(name = "Curso.findByCurfaltaMax", query = "SELECT c FROM Curso c WHERE c.curfaltaMax = :curfaltaMax")})
public class Curso extends Evento implements Serializable{
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "cur_vacantes", nullable = false)
    private int curVacantes;
    @Basic(optional = false)
    @Column(name = "cur_nroSesiones", nullable = false)
    private int curnroSesiones;
    @Basic(optional = false)
    @Column(name = "cur_faltaMax", nullable = false)
    private int curfaltaMax;
    @Basic(optional = false)
    @Column(name = "cur_notaMinima", nullable = false)
    private Double curNotaMinima;
    @Transient
    private ConsejoDepartamental consejo;

    public Curso() {
    }

    public Curso(Integer curCodigo) {
       eveCodigo = curCodigo;
    }

    public Curso(Integer curCodigo, int curVacantes, int curnroSesiones, int curfaltaMax) {
        eveCodigo = curCodigo;
        this.curVacantes = curVacantes;
        this.curnroSesiones = curnroSesiones;
        this.curfaltaMax = curfaltaMax;
    }

    public int getCurVacantes() {
        return curVacantes;
    }
    public void setCurVacantes(int curVacantes) {
        this.curVacantes = curVacantes;
    }

    public int getCurnroSesiones() {
        return curnroSesiones;
    }
    public void setCurnroSesiones(int curnroSesiones) {
        this.curnroSesiones = curnroSesiones;
    }

    public int getCurfaltaMax() {
        return curfaltaMax;
    }
    public void setCurfaltaMax(int curfaltaMax) {
        this.curfaltaMax = curfaltaMax;
    }
    
    public Double getCurNotaMinima() {
        return curNotaMinima;
    }
    public void setCurNotaMinima(Double curNotaMinima) {
        this.curNotaMinima = curNotaMinima;
    }

    @Override
    public ConsejoDepartamental getConsejo() {
        return consejo;
    }
    @Override
    public void setConsejo(ConsejoDepartamental consejo) {
        this.consejo = consejo;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (eveCodigo != null ? eveCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Curso)) {
            return false;
        }
        Curso other = (Curso) object;
        if ((eveCodigo == null && other.eveCodigo != null) || (eveCodigo != null && !this.eveCodigo.equals(other.eveCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.eventos.be.Curso[curCodigo=" + eveCodigo + "]";
    }

    

}
